<template>
    <div class="content banner-box">

    </div>
</template>
<script setup>
import { onMounted, ref, watch } from 'vue'
import { getLeftList, getChanPinXiangqing, getWebXinxi } from '@/api/viewapi.js'
import { useRoute } from 'vue-router';
import { base64Img } from '@/tools/tools.js'
import router from '@/router/index.js';

const MaxData = ref([])
const route = useRoute();
const img = ref('')
const data = ref({})
const webMessage = ref({})
// 跳转详情
const gotoChanpin = (id) => {
    router.push({ path: '/chanpinlist', query: { id: id } })
}



const _getLeftList = () => {
    getLeftList().then((res) => {
        MaxData.value = res.data.data
        console.log('全部产品', res.data.data);
    })
}

const _getChanPinXiangqing = (id) => {
    getChanPinXiangqing(id).then((res) => {
        data.value = res.data
        img.value = res.data.img_name[0]

        console.log(res);
    })
}

const clickImg = (data) => {
    img.value = data
}

const getWebMessage = () => {
    getWebXinxi().then((res) => {
        webMessage.value = res.data.data
        console.log(res);
    })
}


onMounted(() => {
    getWebMessage()
    _getLeftList()
    let id = route.query.id
    _getChanPinXiangqing(id)
})
</script>
<style lang="scss" scoped>
// 取消显示手机端 显示pc端
@media (min-width: 800px) {
    
}

// 取消显示pc端 显示手机端
@media screen and (max-width: 799px) {

}
</style>